'''
n = eval(input("输入整数:"));
print("{0:->20,}".format(n));
'''

'''
a = [3,6,9];
b = eval(input("输入一个列表:"));
s = 0;
for i in range(3):
    s += a[i] * b[i];
print(s)
'''

'''
import random;
random.seed(123);
for i in range(10):
    print(random.randint(1,1000),end = ",")
'''

'''
import turtle;
turtle.right(-30);
turtle.fd(200);
turtle.right(60);
turtle.fd(200);
turtle.right(120);
turtle.fd(200);
turtle.right(60);
turtle.fd(200);
'''

data = input("请输入人员信息:");
average_age = 0;
numofmale = 0;
numof_all = 0;
while data:
    ls = data.split(" ");
    name = ls[0];
    gender = ls[1];
    age = eval(ls[2]);
    numof_all += 1;
    average_age += age;
    if gender == "男":
        numofmale += 1;
    data = input();
average_age = average_age / numof_all;
print("平均年龄是{:.2f} 男性人数是{}".format(average_age,numofmale));
